loans example

Terms from Artificial Intelligence: humans at the heart of algorithms

The glossary is being gradually proof checked, but currently has many typos and misspellings.

This is an example production system about loan approvals used in the AI textbook. The example is coded in Prolog in the code examples for the book.

Rules for the loan example (from Fig.2.5 Production system rules for assessing a loan application):


1. IF <client working? is unknown >
THEN ask "Are you working?"
read WORKING
remove <client working? is unknown >
add <client working? is WORKING >
2. IF <client working? is YES > and <salary is unknown >
THEN ask "What is your salary?"
read SALARY
remove <salary is unknown >
add <salary is SALARY >
3. IF <client working? is YES > and <salary is SALARY > and SALARY > (5 * AMOUNT REQUESTED)
THEN grant loan of AMOUNT REQUESTED
clear database
finish
4. IF <client working? is YES > and <salary is SALARY > and SALARY $\le$ (5 * AMOUNT REQUESTED)
THEN grant loan of (SALARY/5)
clear database
finish
5. IF <client working? is NO > and <client student? is unknown >
THEN ask "Are you a student?"
read STUDENT
remove <client student? is unknown >
add <client student? is STUDENT >
6. IF <client working? is NO > and <client student? is YES >
THEN discuss student loan
clear database
finish
7. IF <client working? is NO > and <client student? is NO >
THEN refuse loan
clear database
finish

Also known as loans example